package com.example.medmobile;

import utils.BaseActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

public class TipoBusca extends BaseActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_tipo_busca);
		
		Button btnBuscaGPS = (Button) findViewById(R.id.btAgendamento);
		btnBuscaGPS.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				try
				{
			 	 Intent intent = new Intent();
			 	 
		         intent.setClass(  TipoBusca.this,
		        		 BuscaHandler.class);
		         Bundle param = new Bundle();
		         param.putBoolean("bBuscaPorGPS", true);
		         intent.putExtras(param);
		         startActivity(intent);
		         finish();
				}
				catch (Exception e)
				{
				 String s = e.getMessage();
				}
				
			}
		});
		
		
		
		Button btnBuscaAvancada = (Button) findViewById(R.id.btBuscaAvancada);
		btnBuscaAvancada.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				try
				{
			 	 Intent intent = new Intent();
			 	 
		         intent.setClass(  TipoBusca.this,
		        		 BuscaHandler.class);
		         Bundle param = new Bundle();
		         param.putBoolean("bBuscaPorGPS", false);
		         intent.putExtras(param);
		         startActivity(intent);
		         finish();
				}
				catch (Exception e)
				{
				 String s = e.getMessage();
				}
				
			}
		});
		
		
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.tipo_busca, menu);
		return true;
	}

}
